/***************************************************
> Copyright (C) 2023 ==KINGYI== All rights reserved.
> File Name: 02共同基类.cpp
> Author: Kingyi
> Mail:joseph2009@163.com 
> Created Time: 2023年07月25日 星期二 15时51分44秒
***************************************************/

#include <iostream>

using namespace std;

class Human
{
	public:
		Human();
		Human(string);
		void display();
	private:
		string name;
};

class Father:public Human
{
	public:
		Father();
		Father(string,string);
		void display();
	private:
		string work;
};

class Mother:public Human
{
	public:
		Mother();
		Mother(string,string);
		void display();
	private:
		string job;
};

class Child:public Father,public Mother
{
	public:
		Child();
		Child(string,string,string,string,string);
		void display();
	private:
		string study;
};

Human::Human() = default;
	
Human::Human(string name)
{
	this->name = name;
}
		
void Human::display()
{
	cout << name;
}


Father::Father() = default;

Father::Father(string name,string work):Human(name)
{
	this->work = work;
}

void Father::display()
{
	Human::display();
	cout <<"," << work;
}

Mother::Mother() = default;

Mother::Mother(string name,string job):Human(name)
{
	this->job = job;

}

void Mother::display()
{
	Human::display();
	cout << "," << job;
}

Child::Child() = default;

Child::Child(string name1,string work,string name2,string job,string study):Father(name1,work),Mother(name2,job)
{
	this->study = study;
}

void Child::display()
{
	cout << study;
}

int main(int argc,const char* argv[])
{

	Child c("娃他爸","吃饭","娃他妈","睡觉","打豆豆");
//	c.Human::Father::display();
//	c.Father::Human::display();
	c.Father::display();
	cout << ",";
	c.Mother::display();
	cout << ",";
	c.display();
	cout << endl;
    return 0;
}
